{template '_header'}
<style>
    .select2{
        margin:0;
        width:100%;
        height:34px;
        border-radius: 3px;
        border-color: rgb(229, 230, 231);
    }
    .select2 .select2-choice{
        height: 34px;
        line-height: 32px;
        border-radius: 3px;
        border-color: rgb(229, 230, 231);
    }
    .select2 .select2-choice .select2-arrow{
        background: #fff;
    }
    .form-group .radio-inline{
        padding-top: 0px;;
    }
    .is_sms {display: {if !empty($opensms)}table-block{else}none{/if};}
</style>
<div class="page-heading">
    <div class="pull-right" style="text-align: right;margin-top: 10px;" >
        <strong>高级模式</strong>
        {ifp 'commission.notice.edit'}
        	<input class="js-switch small" type="checkbox" {if !empty($data['tm']['is_advanced'])}checked{/if}/>
        {else}
        	{if !empty($data['tm']['is_advanced'])}开启{else}关闭{/if}
        {/if}
    </div>
    <h2>通知设置</h2>

</div>
<form id="setform"  {ifp 'commission.notice.edit'}action="" method="post"{/if} class="form-horizontal form-validate">

    <input type="hidden" value="{php echo intval($data['tm']['is_advanced'])}" name='data[is_advanced]' />
    {ifp 'commission.notice.edit'}
    <div class='alert alert-success' id="advanced_alert">
        使用高级模式 , 将全部启用自定义的模板内容进行推送 ! <span class="text-danger"><a href="{php echo webUrl('sysset/tmessage')}">模板库(点击进入)</a> {if $opensms}<span class="text-danger"><a href="{php echo webUrl('sysset/sms/temp')}">短信模板库(点击进入)</a></span>{/if}
    </div>
    <div class='alert alert-info' id="normal_alert">
        默认为全部开启，用户在会员中心可自行设置是否开启, 模板消息自动替换变量 {if $opensms}<span class="text-danger"><a href="{php echo webUrl('sysset/sms/temp')}">短信模板库(点击进入)</a></span>{/if}
    </div>
    {/if}
    <div id="normal">
        <div class="form-group">
            <label class="col-sm-2 control-label">业务处理通知</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'commission.notice.edit'}
                <input type="text" name="data[templateid]" class="form-control" value="{$data['tm']['templateid']}" />
                <div class="help-block">公众平台模板消息编号: OPENTM415477060 </div>
                {else}
                <div class='form-control-static'>{$data['tm']['templateid']}</div>
                {/if}
            </div>
        </div>

        <div class="form-group-title">成为分销商通知</div>

        <div class="form-group">
            <label class="col-sm-2 control-label">标题</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'commission.notice.edit'}
                <input type="text" name="data[commission_becometitle]" class="form-control" value="{$data['tm']['commission_becometitle']}" />
                <div class="help-block">标题，默认"成为分销商通知"</div>
                {else}
                <div class='form-control-static'>{$data['tm']['commission_becometitle']}</div>
                {/if}
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">内容</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'commission.notice.edit'}
                <textarea  name="data[commission_become]" class="form-control" >{$data['tm']['commission_become']}</textarea>
                模板变量: [昵称] [时间]
                {else}
                <div class='form-control-static'>{$data['tm']['commission_become']}</div>
                {/if}

            </div>
        </div>

        <div class="form-group is_sms">
            <label class="col-sm-2 control-label">短信提醒</label>
            <div class="col-sm-9 col-xs-12">
                <select class="select2" {ifp 'commission.notice.edit'}name="data[commission_become_sms]"{else}disabled{/if}>>
                    <option value=''>从短信消息库中选择</option>
                    {loop $template_sms $template_val}
                    <option value="{$template_val['id']}" {if $data['tm']['commission_become_sms'] == $template_val['id'] }selected{/if}>{$template_val['name']}</option>
                    {/loop}
                </select>
            </div>
        </div>

        <div class="form-group-title">新增下级通知</div>

        <div class="form-group">
            <label class="col-sm-2 control-label">标题</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'commission.notice.edit'}
                <input type="text" name="data[commission_agent_newtitle]" class="form-control" value="{$data['tm']['commission_agent_newtitle']}" />
                <div class="help-block">
                    标题，默认"新增下线通知"&nbsp;&nbsp;&nbsp; 默认通知等级 :
                    <label class="radio-inline">
                        <input type="radio" value="0" name="data[commission_agent_new_notice]" {if empty($data['tm']['commission_agent_new_notice'])}checked=""{/if}> {php echo empty($data['texts']['c1'])?'一级':$data['texts']['c1']}[默认]
                    </label>
                    <label class="radio-inline">
                        <input type="radio" value="1" name="data[commission_agent_new_notice]" {if strexists($data['tm']['commission_agent_new_notice'],'1')}checked=""{/if}> {php echo empty($data['texts']['c1'])?'一级':$data['texts']['c1']}+{php echo empty($data['texts']['c2'])?'二级':$data['texts']['c2']}
                    </label>
                    <label class="radio-inline">
                        <input type="radio" value="2" name="data[commission_agent_new_notice]" {if strexists($data['tm']['commission_agent_new_notice'],'2')}checked=""{/if}> {php echo empty($data['texts']['c1'])?'一级':$data['texts']['c1']}+{php echo empty($data['texts']['c2'])?'二级':$data['texts']['c2']}+{php echo empty($data['texts']['c3'])?'三级':$data['texts']['c3']}
                    </label>
                </div>
                {else}
                <div class='form-control-static'>{$data['tm']['commission_agent_newtitle']}</div>
                {/if}
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">内容</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'commission.notice.edit'}
                <textarea  name="data[commission_agent_new]" class="form-control" >{$data['tm']['commission_agent_new']}</textarea>
                <div class='help-block'>模板变量: [下级昵称] [时间] [下线层级]</div>
                {else}
                <div class='form-control-static'>{$data['tm']['commission_agent_new']}</div>
                {/if}
            </div>
        </div>

        <div class="form-group is_sms">
            <label class="col-sm-2 control-label">短信提醒</label>
            <div class="col-sm-9 col-xs-12">
                <select class="select2" {ifp 'commission.notice.edit'}name="data[commission_agent_sms]"{else}disabled{/if}>>
                <option value=''>从短信消息库中选择</option>
                {loop $template_sms $template_val}
                <option value="{$template_val['id']}" {if $data['tm']['commission_agent_sms'] == $template_val['id'] }selected{/if}>{$template_val['name']}</option>
                {/loop}
                </select>
            </div>
        </div>

        <div class="form-group-title">下级付款通知</div>

        <div class="form-group">
            <label class="col-sm-2 control-label">标题</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'commission.notice.edit'}
                <input type="text" name="data[commission_order_paytitle]" class="form-control" value="{$data['tm']['commission_order_paytitle']}" />
                <div class="help-block">
                    标题，默认"下级付款通知"&nbsp;&nbsp;&nbsp;默认通知等级 :
                    <label class="radio-inline">
                        <input type="radio" value="0" name="data[commission_order_pay_notice]" {if empty($data['tm']['commission_order_pay_notice'])}checked=""{/if}> {php echo empty($data['texts']['c1'])?'一级':$data['texts']['c1']}[默认]
                    </label>
                    <label class="radio-inline">
                        <input type="radio" value="1" name="data[commission_order_pay_notice]" {if strexists($data['tm']['commission_order_pay_notice'],'1')}checked=""{/if}> {php echo empty($data['texts']['c1'])?'一级':$data['texts']['c1']}+{php echo empty($data['texts']['c2'])?'二级':$data['texts']['c2']}
                    </label>
                    <label class="radio-inline">
                        <input type="radio" value="2" name="data[commission_order_pay_notice]" {if strexists($data['tm']['commission_order_pay_notice'],'2')}checked=""{/if}> {php echo empty($data['texts']['c1'])?'一级':$data['texts']['c1']}+{php echo empty($data['texts']['c2'])?'二级':$data['texts']['c2']}+{php echo empty($data['texts']['c3'])?'三级':$data['texts']['c3']}
                    </label>
                </div>
                {else}
                <div class='form-control-static'>{$data['tm']['commission_order_paytitle']}</div>
                {/if}
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">内容</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'commission.notice.edit'}
                <textarea  name="data[commission_order_pay]" class="form-control" >{$data['tm']['commission_order_pay']}</textarea>
                <div class="help-block">模板变量 [下级昵称] [订单编号] [订单金额] [商品详情] [佣金金额] [时间] [下线层级]</div>
                <div class="help-block">注意: 此 [佣金金额] ，不代表上级用户会立即获得，为可能获得的佣金金额</div>
                {else}
                <div class='form-control-static'>{$data['tm']['commission_order_pay']}</div>
                {/if}
            </div>
        </div>

        <div class="form-group is_sms">
            <label class="col-sm-2 control-label">短信提醒</label>
            <div class="col-sm-9 col-xs-12">
                <select class="select2" {ifp 'commission.notice.edit'}name="data[commission_order_pay_sms]"{else}disabled{/if}>>
                <option value=''>从短信消息库中选择</option>
                {loop $template_sms $template_val}
                <option value="{$template_val['id']}" {if $data['tm']['commission_order_pay_sms'] == $template_val['id'] }selected{/if}>{$template_val['name']}</option>
                {/loop}
                </select>
            </div>
        </div>

        <div class="form-group-title">下级确认收货通知</div>

        <div class="form-group">
            <label class="col-sm-2 control-label">标题</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'commission.notice.edit'}
                <input type="text" name="data[commission_order_finishtitle]" class="form-control" value="{$data['tm']['commission_order_finishtitle']}" />
                <div class="help-block">
                    标题，默认"下级确认收货通知"&nbsp;&nbsp;&nbsp;默认通知等级 :
                    <label class="radio-inline">
                        <input type="radio" value="0" name="data[commission_order_finish_notice]" {if empty($data['tm']['commission_order_finish_notice'])}checked=""{/if}> {php echo empty($data['texts']['c1'])?'一级':$data['texts']['c1']}[默认]
                    </label>
                    <label class="radio-inline">
                        <input type="radio" value="1" name="data[commission_order_finish_notice]" {if strexists($data['tm']['commission_order_finish_notice'],'1')}checked=""{/if}>{php echo empty($data['texts']['c1'])?'一级':$data['texts']['c1']}+{php echo empty($data['texts']['c2'])?'二级':$data['texts']['c2']}
                    </label>
                    <label class="radio-inline">
                        <input type="radio" value="2" name="data[commission_order_finish_notice]" {if strexists($data['tm']['commission_order_finish_notice'],'2')}checked=""{/if}>{php echo empty($data['texts']['c1'])?'一级':$data['texts']['c1']}+{php echo empty($data['texts']['c2'])?'二级':$data['texts']['c2']}+{php echo empty($data['texts']['c3'])?'三级':$data['texts']['c3']}
                    </label>
                </div>
                {else}
                <div class='form-control-static'>{$data['tm']['commission_order_finishtitle']}</div>
                {/if}
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">内容</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'commission.notice.edit'}
                <textarea  name="data[commission_order_finish]" class="form-control" >{$data['tm']['commission_order_finish']}</textarea>
                <div class="help-block">模板变量 [下级昵称] [订单编号] [订单金额] [商品详情] [佣金金额] [时间] [下线层级]</div>
                <div class="help-block">注意: 此 [佣金金额] ，不代表上级用户会立即获得，为可能获得的佣金金额</div>
                {else}
                <div class='form-control-static'>{$data['tm']['commission_order_finish']}</div>
                {/if}
            </div>
        </div>

        <div class="form-group is_sms">
            <label class="col-sm-2 control-label">短信提醒</label>
            <div class="col-sm-9 col-xs-12">
                <select class="select2" {ifp 'commission.notice.edit'}name="data[commission_order_finish_sms]"{else}disabled{/if}>>
                <option value=''>从短信消息库中选择</option>
                {loop $template_sms $template_val}
                <option value="{$template_val['id']}" {if $data['tm']['commission_order_finish_sms'] == $template_val['id'] }selected{/if}>{$template_val['name']}</option>
                {/loop}
                </select>
            </div>
        </div>

        <div class="form-group-title">提现申请提交通知</div>

        <div class="form-group">
            <label class="col-sm-2 control-label">标题</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'commission.notice.edit'}
                <input type="text" name="data[commission_applytitle]" class="form-control" value="{$data['tm']['commission_applytitle']}" />
                <div class="help-block">标题，默认"提现申请提交通知"</div>
                {else}
                <div class='form-control-static'>{$data['tm']['commission_applytitle']}</div>
                {/if}
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">内容</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'commission.notice.edit'}
                <textarea  name="data[commission_apply]" class="form-control" >{$data['tm']['commission_apply']}</textarea>
                模板变量 [昵称] [时间] [金额] [提现方式]
                {else}
                <div class='form-control-static'>{$data['tm']['commission_apply']}</div>
                {/if}
            </div>
        </div>

        <div class="form-group is_sms">
            <label class="col-sm-2 control-label">短信提醒</label>
            <div class="col-sm-9 col-xs-12">
                <select class="select2" {ifp 'commission.notice.edit'}name="data[commission_apply_sms]"{else}disabled{/if}>>
                <option value=''>从短信消息库中选择</option>
                {loop $template_sms $template_val}
                <option value="{$template_val['id']}" {if $data['tm']['commission_apply_sms'] == $template_val['id'] }selected{/if}>{$template_val['name']}</option>
                {/loop}
                </select>
            </div>
        </div>

        <div class="form-group-title">提现申请审核完成通知</div>

        <div class="form-group">
            <label class="col-sm-2 control-label">标题</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'commission.notice.edit'}
                <input type="text" name="data[commission_checktitle]" class="form-control" value="{$data['tm']['commission_checktitle']}" />
                <div class="help-block">标题，默认"提现申请审核完成通知"</div>
                {else}
                <div class='form-control-static'>{$data['tm']['commission_checktitle']}</div>
                {/if}
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">内容</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'commission.notice.edit'}
                <textarea  name="data[commission_check]" class="form-control" >{$data['tm']['commission_check']}</textarea>
                模板变量 [昵称] [提现方式]  [金额] [时间]
                {else}
                <div class='form-control-static'>{$data['tm']['commission_check']}</div>
                {/if}
            </div>
        </div>

        <div class="form-group is_sms">
            <label class="col-sm-2 control-label">短信提醒</label>
            <div class="col-sm-9 col-xs-12">
                <select class="select2" {ifp 'commission.notice.edit'}name="data[commission_check_sms]"{else}disabled{/if}>>
                <option value=''>从短信消息库中选择</option>
                {loop $template_sms $template_val}
                <option value="{$template_val['id']}" {if $data['tm']['commission_check_sms'] == $template_val['id'] }selected{/if}>{$template_val['name']}</option>
                {/loop}
                </select>
            </div>
        </div>

        <div class="form-group-title">佣金打款通知</div>

        <div class="form-group">
            <label class="col-sm-2 control-label">标题</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'commission.notice.edit'}
                <input type="text" name="data[commission_paytitle]" class="form-control" value="{$data['tm']['commission_paytitle']}" />
                <div class="help-block">标题，默认"佣金打款通知"</div>
                {else}
                <div class='form-control-static'>{$data['tm']['commission_paytitle']}</div>
                {/if}
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">内容</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'commission.notice.edit'}
                <textarea  name="data[commission_pay]" class="form-control" >{$data['tm']['commission_pay']}</textarea>
                模板变量 [昵称] [提现方式] [金额] [时间]
                {else}
                <div class='form-control-static'>{$data['tm']['commission_pay']}</div>
                {/if}
            </div>
        </div>

        <div class="form-group is_sms">
            <label class="col-sm-2 control-label">短信提醒</label>
            <div class="col-sm-9 col-xs-12">
                <select class="select2" {ifp 'commission.notice.edit'}name="data[commission_pay_sms]"{else}disabled{/if}>>
                <option value=''>从短信消息库中选择</option>
                {loop $template_sms $template_val}
                <option value="{$template_val['id']}" {if $data['tm']['commission_pay_sms'] == $template_val['id'] }selected{/if}>{$template_val['name']}</option>
                {/loop}
                </select>
            </div>
        </div>

        <div class="form-group-title">分销商等级升级通知</div>

        <div class="form-group">
            <label class="col-sm-2 control-label">标题</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'commission.notice.edit'}
                <input type="text" name="data[commission_upgradetitle]" class="form-control" value="{$data['tm']['commission_upgradetitle']}" />
                <div class="help-block">标题，默认"分销商等级升级通知"</div>
                {else}
                <div class='form-control-static'>{$data['tm']['commission_upgradetitle']}</div>
                {/if}
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">内容</label>
            <div class="col-sm-9 col-xs-12">
                {ifp 'commission.notice.edit'}
                <textarea  name="data[commission_upgrade]" class="form-control" >{$data['tm']['commission_upgrade']}</textarea>
                模板变量: [昵称] [旧等级]  [旧一级分销比例] [旧二级分销比例] [旧三级分销比例] [新等级] [新一级分销比例] [新二级分销比例] [新三级分销比例]  [时间]
                {else}
                <div class='form-control-static'>{$data['tm']['commission_upgrade']}</div>
                {/if}
            </div>
        </div>

        <div class="form-group is_sms">
            <label class="col-sm-2 control-label">短信提醒</label>
            <div class="col-sm-9 col-xs-12">
                <select class="select2" {ifp 'commission.notice.edit'}name="data[commission_upgrade_sms]"{else}disabled{/if}>>
                <option value=''>从短信消息库中选择</option>
                {loop $template_sms $template_val}
                <option value="{$template_val['id']}" {if $data['tm']['commission_upgrade_sms'] == $template_val['id'] }selected{/if}>{$template_val['name']}</option>
                {/loop}
                </select>
            </div>
        </div>

    </div>
    <div id="advanced">

        <table class="table table-responsive">
            <thead>
            <th style="width: 150px;">通知类型</th>
            <th>模板消息</th>
            <th class="is_sms">短信模板(不选则不提醒)</th>
            <th style="width: 150px;">默认通知等级</th>
            </thead>
            <tbody>
            <tr>
                <td>成为分销商通知</td>
                <td>
                    <select class="select2" {ifp 'commission.notice.edit'}name="data[commission_become_advanced]"{else}disabled{/if}>
                    <option value=''>从模板消息库中选择</option>
                    {loop $template_list $template_val}
                    <option value="{$template_val['id']}" {if $data['tm']['commission_become_advanced'] == $template_val['id'] }selected{/if}>{$template_val['title']}</option>
                    {/loop}
                    </select>
                </td>
                <td class="is_sms">
                    <select class="select2" {ifp 'commission.notice.edit'}name="data[commission_become_sms_advanced]"{else}disabled{/if}>
                    <option value=''>从短信消息库中选择</option>
                    {loop $template_sms $template_val}
                    <option value="{$template_val['id']}" {if $data['tm']['commission_become_sms_advanced'] == $template_val['id'] }selected{/if}>{$template_val['name']}</option>
                    {/loop}
                    </select>
                </td>
                <td>-</td>
            </tr>
            <tr>
                <td>新增下级通知</td>
                <td>
                    <select class="select2" {ifp 'commission.notice.edit'}name="data[commission_agent_new_advanced]"{else}disabled{/if}>
                    <option value=''>从模板消息库中选择</option>
                    {loop $template_list $template_val}
                    <option value="{$template_val['id']}" {if $data['tm']['commission_agent_new_advanced'] == $template_val['id'] }selected{/if}>{$template_val['title']}</option>
                    {/loop}
                    </select>
                </td>
                <td class="is_sms">
                    <select class="select2" {ifp 'commission.notice.edit'}name="data[commission_agent_new_sms_advanced]"{else}disabled{/if}>
                    <option value=''>从短信消息库中选择</option>
                    {loop $template_sms $template_val}
                    <option value="{$template_val['id']}" {if $data['tm']['commission_agent_new_sms_advanced'] == $template_val['id'] }selected{/if}>{$template_val['name']}</option>
                    {/loop}
                    </select>
                </td>
                <td>
                    <label class="radio-inline"><input type="radio" value="0" name="data[commission_agent_new_advanced_notice]" {if empty($data['tm']['commission_agent_new_advanced_notice'])}checked=""{/if}> {php echo empty($data['texts']['c1'])?'一级':$data['texts']['c1']}[默认]</label><br>
                    <label class="radio-inline"><input type="radio" value="1" name="data[commission_agent_new_advanced_notice]" {if strexists($data['tm']['commission_agent_new_advanced_notice'],'1')}checked=""{/if}> {php echo empty($data['texts']['c1'])?'一级':$data['texts']['c1']}+{php echo empty($data['texts']['c2'])?'二级':$data['texts']['c2']}</label><br>
                    <label class="radio-inline"><input type="radio" value="2" name="data[commission_agent_new_advanced_notice]" {if strexists($data['tm']['commission_agent_new_advanced_notice'],'2')}checked=""{/if}> {php echo empty($data['texts']['c1'])?'一级':$data['texts']['c1']}+{php echo empty($data['texts']['c2'])?'二级':$data['texts']['c2']}+{php echo empty($data['texts']['c3'])?'三级':$data['texts']['c3']}</label>
                </td>
            </tr>
            </tbody>
         </table>

        <table class="table table-responsive">
            <thead>
            <th style="width: 150px;">下级通知</th>
            <th>模板消息</th>
            <th class="is_sms">短信模板(不选则不提醒)</th>
            <th style="width: 150px;">默认通知等级</th>
            </thead>
            <tbody>
            <tr>
                <td>下级付款通知</td>
                <td>
                    <select class="select2" {ifp 'commission.notice.edit'}name="data[commission_order_pay_advanced]"{else}disabled{/if}>
                    <option value=''>从模板消息库中选择</option>
                    {loop $template_list $template_val}
                    <option value="{$template_val['id']}" {if $data['tm']['commission_order_pay_advanced'] == $template_val['id'] }selected{/if}>{$template_val['title']}</option>
                    {/loop}
                    </select>
                </td>
                <td class="is_sms">
                    <select class="select2" {ifp 'commission.notice.edit'}name="data[commission_order_pay_sms_advanced]"{else}disabled{/if}>
                    <option value=''>从短信消息库中选择</option>
                    {loop $template_sms $template_val}
                    <option value="{$template_val['id']}" {if $data['tm']['commission_order_pay_sms_advanced'] == $template_val['id'] }selected{/if}>{$template_val['name']}</option>
                    {/loop}
                    </select>
                </td>
                <td>
                    <label class="radio-inline"><input type="radio" value="0" name="data[commission_order_pay_advanced_notice]" {if empty($data['tm']['commission_order_pay_advanced_notice'])}checked=""{/if}> {php echo empty($data['texts']['c1'])?'一级':$data['texts']['c1']}[默认]</label><br>
                    <label class="radio-inline"><input type="radio" value="1" name="data[commission_order_pay_advanced_notice]" {if strexists($data['tm']['commission_order_pay_advanced_notice'],'1')}checked=""{/if}> {php echo empty($data['texts']['c1'])?'一级':$data['texts']['c1']}+{php echo empty($data['texts']['c2'])?'二级':$data['texts']['c2']}</label><br>
                    <label class="radio-inline"><input type="radio" value="2" name="data[commission_order_pay_advanced_notice]" {if strexists($data['tm']['commission_order_pay_advanced_notice'],'2')}checked=""{/if}> {php echo empty($data['texts']['c1'])?'一级':$data['texts']['c1']}+{php echo empty($data['texts']['c2'])?'二级':$data['texts']['c2']}+{php echo empty($data['texts']['c3'])?'三级':$data['texts']['c3']}</label>
                </td>
            </tr>
            <tr>
                <td>下级确认收货通知</td>
                <td>
                    <select class="select2" {ifp 'commission.notice.edit'}name="data[commission_order_finish_advanced]"{else}disabled{/if}>
                    <option value=''>从模板消息库中选择</option>
                    {loop $template_list $template_val}
                    <option value="{$template_val['id']}" {if $data['tm']['commission_order_finish_advanced'] == $template_val['id'] }selected{/if}>{$template_val['title']}</option>
                    {/loop}
                    </select>
                </td>
                <td class="is_sms">
                    <select class="select2" {ifp 'commission.notice.edit'}name="data[commission_order_finish_sms_advanced]"{else}disabled{/if}>
                    <option value=''>从短信消息库中选择</option>
                    {loop $template_sms $template_val}
                    <option value="{$template_val['id']}" {if $data['tm']['commission_order_finish_sms_advanced'] == $template_val['id'] }selected{/if}>{$template_val['name']}</option>
                    {/loop}
                    </select>
                </td>
                <td>
                    <label class="radio-inline"><input type="radio" value="0" name="data[commission_order_finish_advanced_notice]" {if empty($data['tm']['commission_order_finish_advanced_notice'])}checked=""{/if}> {php echo empty($data['texts']['c1'])?'一级':$data['texts']['c1']}[默认]
</label><br>
                    <label class="radio-inline"><input type="radio" value="1" name="data[commission_order_finish_advanced_notice]" {if strexists($data['tm']['commission_order_finish_advanced_notice'],'1')}checked=""{/if}>{php echo empty($data['texts']['c1'])?'一级':$data['texts']['c1']}+{php echo empty($data['texts']['c2'])?'二级':$data['texts']['c2']}</label><br>
                    <label class="radio-inline"><input type="radio" value="2" name="data[commission_order_finish_advanced_notice]" {if strexists($data['tm']['commission_order_finish_advanced_notice'],'2')}checked=""{/if}>{php echo empty($data['texts']['c1'])?'一级':$data['texts']['c1']}+{php echo empty($data['texts']['c2'])?'二级':$data['texts']['c2']}+{php echo empty($data['texts']['c3'])?'三级':$data['texts']['c3']}</label>
                </td>
            </tr>
            </tbody>
        </table>

        <table class="table table-responsive">
            <thead>
            <th style="width: 150px;">提现通知</th>
            <th>模板消息</th>
            <th class="is_sms">短信模板(不选则不提醒)</th>
            <th style="width: 150px;"></th>
            </thead>
            <tbody>
            <tr>
                <td>提现申请提交通知</td>
                <td>
                    <select class="select2" {ifp 'commission.notice.edit'}name="data[commission_apply_advanced]"{else}disabled{/if}>
                    <option value=''>从模板消息库中选择</option>
                    {loop $template_list $template_val}
                    <option value="{$template_val['id']}" {if $data['tm']['commission_apply_advanced'] == $template_val['id'] }selected{/if}>{$template_val['title']}</option>
                    {/loop}
                    </select>
                </td>
                <td class="is_sms">
                    <select class="select2" {ifp 'commission.notice.edit'}name="data[commission_apply_sms_advanced]"{else}disabled{/if}>
                    <option value=''>从短信消息库中选择</option>
                    {loop $template_sms $template_val}
                    <option value="{$template_val['id']}" {if $data['tm']['commission_apply_sms_advanced'] == $template_val['id'] }selected{/if}>{$template_val['name']}</option>
                    {/loop}
                    </select>
                </td>
                <td></td>
            </tr>
            <tr>
                <td>提现申请审核完成通知</td>
                <td>
                    <select class="select2" {ifp 'commission.notice.edit'}name="data[commission_check_advanced]"{else}disabled{/if}>
                    <option value=''>从模板消息库中选择</option>
                    {loop $template_list $template_val}
                    <option value="{$template_val['id']}" {if $data['tm']['commission_check_advanced'] == $template_val['id'] }selected{/if}>{$template_val['title']}</option>
                    {/loop}
                    </select>
                </td>
                <td class="is_sms">
                    <select class="select2" {ifp 'commission.notice.edit'}name="data[commission_check_sms_advanced]"{else}disabled{/if}>
                    <option value=''>从短信消息库中选择</option>
                    {loop $template_sms $template_val}
                    <option value="{$template_val['id']}" {if $data['tm']['commission_check_sms_advanced'] == $template_val['id'] }selected{/if}>{$template_val['name']}</option>
                    {/loop}
                    </select>
                </td>
                <td></td>
            </tr>
            </tbody>
        </table>

        <table class="table table-responsive">
            <thead>
            <th style="width: 150px;">佣金通知</th>
            <th>模板消息</th>
            <th class="is_sms">短信模板(不选则不提醒)</th>
            <th style="width: 150px;"></th>
            </thead>
            <tbody>
            <tr>
                <td>佣金打款通知</td>
                <td>
                    <select class="select2" {ifp 'commission.notice.edit'}name="data[commission_pay_advanced]"{else}disabled{/if}>
                    <option value=''>从模板消息库中选择</option>
                    {loop $template_list $template_val}
                    <option value="{$template_val['id']}" {if $data['tm']['commission_pay_advanced'] == $template_val['id'] }selected{/if}>{$template_val['title']}</option>
                    {/loop}
                    </select>
                </td>
                <td class="is_sms">
                    <select class="select2" {ifp 'commission.notice.edit'}name="data[commission_pay_sms_advanced]"{else}disabled{/if}>
                    <option value=''>从短信消息库中选择</option>
                    {loop $template_sms $template_val}
                    <option value="{$template_val['id']}" {if $data['tm']['commission_pay_sms_advanced'] == $template_val['id'] }selected{/if}>{$template_val['name']}</option>
                    {/loop}
                    </select>
                </td>
                <td></td>
            </tr>
            <tr>
                <td>分销商等级升级通知</td>
                <td>
                    <select class="select2" {ifp 'commission.notice.edit'}name="data[commission_upgrade_advanced]"{else}disabled{/if}>
                    <option value=''>从模板消息库中选择</option>
                    {loop $template_list $template_val}
                    <option value="{$template_val['id']}" {if $data['tm']['commission_upgrade_advanced'] == $template_val['id'] }selected{/if}>{$template_val['title']}</option>
                    {/loop}
                    </select>
                </td>
                <td class="is_sms">
                    <select class="select2" {ifp 'commission.notice.edit'}name="data[commission_upgrade_sms_advanced]"{else}disabled{/if}>
                    <option value=''>从短信消息库中选择</option>
                    {loop $template_sms $template_val}
                    <option value="{$template_val['id']}" {if $data['tm']['commission_upgrade_sms_advanced'] == $template_val['id'] }selected{/if}>{$template_val['name']}</option>
                    {/loop}
                    </select>
                </td>
                <td></td>
            </tr>
            </tbody>
        </table>




    </div>
    {ifp 'commission.notice.edit'}
    <div class="form-group">
        <label class="col-sm-2 control-label"></label>
        <div class="col-sm-12">
            <input type="submit" value="提交" class="btn btn-primary" />
        </div>
    </div>
    {/if}
</form>
<script>
    $(function () {
        $(".js-switch").click(function () {
            $(":input[name='data[is_advanced]']").val( this.checked ?1:0);
            if (this.checked)
            {
                $("#advanced,#advanced_alert").show();
                $("#normal,#normal_alert").hide();
            }
            else
            {
                $("#advanced,#advanced_alert").hide();
                $("#normal,#normal_alert").show();
            }
        })

        if($(":input[name='data[is_advanced]']").val() == 1)
        {
            $("#advanced,#advanced_alert").show();
            $("#normal,#normal_alert").hide();
        }
        else
        {
            $("#advanced,#advanced_alert").hide();
            $("#normal,#normal_alert").show();
        }
    })
</script>
{template '_footer'}